//
//  Person.m
//  rolling
//
//  Created by Mac on 10-7-11.
//  Copyright 2010 __MyCompanyName__. All rights reserved.
//

#import "Person.h"


@implementation Person
@synthesize location;
@synthesize width;
@synthesize image;
@synthesize speedX;
@synthesize speedY;
@synthesize imageName;

-(id) init{
	self.imageName = @"ladybug.png";
	self.width = 17.5;
	self.image = [UIImage imageNamed:self.imageName];
	location.x =160.0;
	location.y =240.0;
	speedX = 0.0;
	speedY = 0.0;
	return self;
}

-(id) isAtBoundary{
	if (self.location.x <= 0.0) {
		location.x = 0.0;
		speedX = 0.0;
	}
	if (self.location.x >= 320.0 - 2*width) {
		location.x = 320.0 - 2*width;
		speedX = 0.0;
	}
	if (self.location.y <= 0.0) {
		location.y = 0.0;
		speedY = 0.0;
	}
	if (self.location.y >= 460.0 - 2*width) {
		location.y = 460.0 - 2*width;
		speedY = 0.0;
	}
		
	return self;
}

@end
